﻿using System;
using System.IO;
using UnityEngine;

namespace RenderHeads.Media.AVProVideo.Demos
{
	// Token: 0x0200000D RID: 13
	public class LoadFromBuffer : MonoBehaviour
	{
		// Token: 0x0600003F RID: 63 RVA: 0x00003BC0 File Offset: 0x00001DC0
		private void Start()
		{
			if (this._mp != null)
			{
				byte[] array = null;
				using (FileStream fileStream = new FileStream(this._filename, FileMode.Open, FileAccess.Read))
				{
					using (BinaryReader binaryReader = new BinaryReader(fileStream))
					{
						long length = new FileInfo(this._filename).Length;
						array = binaryReader.ReadBytes((int)length);
					}
				}
				if (array != null)
				{
					this._mp.OpenVideoFromBuffer(array, true);
				}
			}
		}

		// Token: 0x04000032 RID: 50
		[SerializeField]
		private MediaPlayer _mp;

		// Token: 0x04000033 RID: 51
		[SerializeField]
		private string _filename;
	}
}
